package com.example.lp.lpuicore.paint.model;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.SweepGradient;

/**
 * Author by lp,on 2021/6/17/017,14:30.
 */
public class ScannRendering implements IPaintModel {
    @Override
    public void draw(Canvas canvas, Paint paint) {
        /**
         * 扫描渲染，SweepGradient(float cx, float cy, @ColorInt int color0,int color1)
         * cx,cy 渐变中心坐标
         * color0,color1：渐变开始结束颜色
         * colors，positions：类似LinearGradient,用于多颜色渐变,positions为null时，根据颜色线性渐变
         */
        SweepGradient mShader = new SweepGradient(125, 125, Color.RED, Color.GREEN);
        paint.setShader(mShader);
        canvas.drawCircle(125, 125, 125, paint);
    }
}
